package com.hxzy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hxzy.dto.SysDictTypeDTO;
import com.hxzy.entity.SysDictType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 数据字典
 */
@Mapper
public interface SysDictTypeMapper extends BaseMapper<SysDictType> {

    IPage<SysDictType> search(IPage<SysDictType> iPage, @Param(value = "dto") SysDictTypeDTO sysDictTypeDTO);

    /**
     * 更新字典的状态
     * @param dictId
     * @param state
     * @return
     */
    @Update(value = "update sys_dict_type set status=#{state} where dict_id=#{dictId}")
    int updateByState(@Param(value = "dictId")Long dictId, @Param(value = "state")String state);
}